package day11;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

/**
 * @author oldliu
 * @since 1.0
 */
public class ArrayListTest {
    public static void main(String[] args) {

        List<Integer> l=new ArrayList<>();
        A a =new A(l);
        A a1 =new A(l);
        A a2 =new A(l);
        a.start();
        a1.start();
        a2.start();
    }
}
class A extends Thread{
    private List<Integer> list;
    public A(List<Integer> l){
        this.list=l;
    }

    @Override
    public void run() {
        for(int i=1;i<=1000;i++)
        {
            //synchronized (list){
                list.add(i);
            //}

        }
    }
}
